@extends('home/common/home_layout')
@section('content')
<hr>
<div id="content" class="clearfix" style="min-height: 105px;">
<div class="main">
<section class="breadcrumb">
<a href="/lin_home_list">首页</a>
<i>&gt;</i>
<span>{{$data['storename']}}</span>
</section>
<section class="basicinfo">
<div class="b-img fl">
<img src="/publics/lilin/home_layout_style/images/{{$data['storepic']}}"  width="198" height="120">
</div>
<div class="b-info fl">
<div class="one-line">
<h2>{{$data['storename']}}</h2>
<span>e行专送</span>
</div>
<div class="all-show">
<h2>{{$data['storename']}}</h2>
<span>e行专送</span>
</div>
<span class=""><img src="/publics/lilin/shop_style/picture/certificated_s.png"></span><dl>
<dt>餐饮</dt>
<dd class="rate-con">
<span class="rate">
<span class="rate-inner" style="width:{{$star[6]*75/5}}px;
background-image: url(/publics/lilin/shop_style/images/common_z_22caf52.png);
background-position: 0px -21px;
display: inline-block;
height: 11px;
vertical-align: top;
background-repeat: no-repeat;
letter-spacing: 0;
"></span>
</span>
{{round($star[6],1)}}分</dd>
</dl>
<dl>
<dt><i class="icon icon-time"></i>接单时间:&nbsp;</dt>
<dd class="bussinessStatus">
<span>{{$data['worktime']}}</span>
<strong class="doing">{{$data['storestatus']}}</strong>
</dd>
</dl>
<dl>
<dt><i class="icon icon-address"></i>商户地址:&nbsp;</dt>
<dd>
{{$data['storeaddress']}}
</dd>
</dl>
<div class="overall">
<h3 class="title">总体评分</h3>
<div class="rate-info">
<div class="rate-num">{{round($star[6],1)}}</div>
<p class="pos">
<span class="rate">
<span class="rate-inner" style="width:{{$star[6]*75/5}}px;
background-image: url(/publics/lilin/shop_style/images/common_z_22caf52.png);
background-position: 0px -21px;
display: inline-block;
height: 11px;
vertical-align: top;
background-repeat: no-repeat;
letter-spacing: 0;
"></span>
</span>
</p>
<p>
<span>共{{$star[0]}}条评价</span>
</p>
</div>
<table class="rate-table">
<tbody><tr>
<td width="30px">5分</td>
<td width="150px">
<span class="pnum">
<span class="pnum-inner" style="width:{{$star[5]/$star[0]*140}}px"></span>
</span>
</td>
<td>{{$star[5]}}人</td>
</tr>
<tr>
<td>4分</td>
<td>
<span class="pnum">
<span class="pnum-inner" style="width:{{$star[4]/$star[0]*140}}px"></span>
</span>
</td>
<td>{{$star[4]}}人</td>
</tr>
<tr>
<td>3分</td>
<td>
<span class="pnum">
<span class="pnum-inner" style="width:{{$star[3]/$star[0]*140}}px"></span>
</span>
</td>
<td>{{$star[3]}}人</td>
</tr>
<tr>
<td>2分</td>
<td>
<span class="pnum">
<span class="pnum-inner" style="width:{{$star[2]/$star[0]*140}}px"></span>
</span>
</td>
<td>{{$star[2]}}人</td>
</tr>
<tr>
<td>1分</td>
<td>
<span class="pnum">
<span class="pnum-inner" style="width:{{$star[1]/$star[0]*140}}px"></span>
</span>
</td>
<td>{{$star[1]}}人</td>
</tr>
</tbody></table>
</div>
</div>
<div class="b-cost fr">
<div class="b-value">¥<strong class="b-num" id='lilin_sendprice'>{{$data['sendprice']}}</strong></div>
<p class="b-label">配送费</p>
</div>
<div class="b-divider fr"></div>
<div class="b-price fr">
<div class="b-value">¥<strong class="b-num">{{$data['upsendprice']}}</strong></div>
<p class="b-label">起送价</p>
</div>
<div class="b-divider fr"></div>
<div class="b-totime fr">
<div class="b-value">
<strong class="b-num">
{{$data['cooktime']}}分钟</strong>
<span class="num-unit"></span>
</div>
<p class="b-label">平均送达时间</p>
</div>
</section>
<div class="main-l">
	<div class="annouce">
		<span class="sound-icon"></span>
		<span>今日下单可选择今日-{{date('m.d',time()+24*3600)}}配送</span>
	</div>


	<section class="menu-tab clearfix">
		<ul id='lilin'>
			<li class="txt lilin" ><a href="/lin_home_list/create?id={{$id}}">菜单</a></li>
			<li class="txt"><a href="/lin_home_list/{{$id}}/edit">评价</a></li>
			<li class="txt"><a href="/shopui/shopcertificate?shop_id=1826255164">资质</a></li>
		</ul>
	</section>
	
	
	<!-- 菜单分类导航 start-->

	<section class="menu-filter-wrapper">
		<section class="menu-filter clearfix">
			<div>
			<!-- 遍历 start	 -->
			@foreach($type as $k=>$v)
				<a class="filter-item" category_id="" href="#{{$v['menu_type_name']}}" data="0">
					<span class="item-name" title="热销">&nbsp;&nbsp;&nbsp;{{$v['menu_type_name']}}&nbsp;&nbsp;&nbsp;</span>
					<em class="item-num">(6)</em>
				</a>
			@endforeach
			<!-- 遍历 end	 -->	
			</div>
			<div class="bottomArr" data-node="bottomArr">
			</div>
		</section>
	
	</section>

	<!-- 菜单分类导航 end-->

	<section class="menu-list">
		<!-- 此分类下的菜  遍历 start-->
		@foreach($type as $k=>$v)
		<div class="list-wrap" id="menu_0">
			<div class="list-status">
				<span class="title">{{$v['menu_type_name']}}</span>
			</div>
			<!-- {{dump($v['menu_type_name'])}} -->
			<div class="list clearfix">
				<ul>
				@foreach($menu[$k] as $kk=>$vv)
					<li class="list-item">
						<figure class="headimg fl">
							<div class="bg-img" style="background: url(/publics/lilin/shop_style/images/2837a45a9c11440686775d37239c65fd.gif) center center no-repeat;background-size:cover;-webkit-background-size:cover;-o-background-size:cover;-moz-background-size:cover;-ms-background-size:cover;" id="{{$v['menu_type_name']}}">
							</div>
						</figure>
						<div class="info fl" id="{{$data['storename']}}_{{$v['menu_type_name']}}_{{$vv['menu_name']}}">
							<h3>
								{{$vv['menu_name']}}
							</h3>
							<div class="info-desc">
								<p class="m-hot-value">
									<span class="sales-count">{{$vv['recommend_person_num']}}人推荐</span>
									<span class="divider"></span>
									<span class="sales-count">月售{{$vv['mouth_sell_num']}}份</span>
								</p>
								<p class="m-hot-value">
								</p>
							</div>
							<div class="m-price">
								<strong>¥{{$vv['menu_price']}}</strong>
							</div>
						</div>
					

						<!-- unselectable=on 不会失去焦点  失去焦点事件不起作用 -->
						<div class="m-sel-icon" unselectable="on">
							<div class="select-con">
								
								<a href="javascript:void(0);" 
									<strong class="minusfrcart" id="{{$vv['id']}}_min" data-node="minusfrcart"></strong>
								</a>

								<strong class="lilin_count" id="{{$vv['id']}}">0</strong>

								<a href="javascript:void(0);">
									<strong class="addtocart" id="{{$vv['id']}}_add" data-node="addtocart"></strong>
								</a>
						
								
				<!-- 菜单点击事件  数字变化  购物车变化 start -->

				<script type="text/javascript">

					$(function(){

						var sendprice = parseInt($('#lilin_sendprice').html());
						var food_id = $('#{{$vv["id"]}}').attr('id');

						var food_name='{{$vv["menu_name"]}}';
						
						var num = parseInt($('#{{$vv["id"]}}').html());

						var food_price='{{$vv["menu_price"]}}';

						var store_id = '{{$vv["menu_store_id"]}}';

						$('#{{$vv["id"]}}_add').click(function(){

							num = num+1;

							$('#{{$vv["id"]}}').html(num);

								$.ajaxSetup({
		                    		headers: {
		                        		'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		                    		}
		                		});



		                		$.post('/order_lilin',{food_id:food_id,food_name:food_name,num:num,food_price:food_price,store_id:store_id},function(msg){
		                				// alert(msg);
		                				var str = '';

		                				if(msg==''){
		                					// var yes_='<span>购物车为空</span>';
		                					$('#lilin_car').html("");

		                				}else{
		                					var h = "购物车<br>菜品 份数 单价<br>";
		                					var tot=0;
		                					$.each(msg, function(index, val) {
		                						
		                						tot = tot+val.o_price;
		                					str = str+'<td>'+msg[index].food_name+'&nbsp;&nbsp;</td>'+'<td>'+msg[index].o_num+'&nbsp;&nbsp;</td>'+'<td>¥'+msg[index].o_price+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><br>';
		                					var sp='配送费:¥'+sendprice+'<br>';
		                					var t = '共计:¥'+parseInt(tot+sendprice);
		                					var a = '&nbsp;&nbsp;&nbsp;&nbsp;<a id="lilin_jie" href="/order_lilin" role="button">选好了</a>';

		                					str_h = h+str+sp+t+a;

		                				});
		                				
		                				$('#lilin_car').html(str_h);
		                				
		                				}
		                				
		                		})
							
						});

						$('#{{$vv["id"]}}_min').click(function(){

							num = num-1;

							if(num>0){
								
								$('#{{$vv["id"]}}').html(num);

								$.ajaxSetup({
                    				headers: {
                        				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    				}
                				});



		                		$.post('/order_lilin',{food_id:food_id,food_name:food_name,num:num,food_price:food_price,store_id:store_id},function(msg){
// var str = '';

		                				var str = '';

		                				if(msg==''){
		                					// var yes_='<span>购物车为空</span>';
		                					$('#lilin_car').html("");

		                				}else{
											var h = "购物车<br>菜品 份数 单价<br>";
		                					var tot=0;
		                					$.each(msg, function(index, val) {
		                						
		                						tot = tot+val.o_price;
		                					str = str+'<td>'+msg[index].food_name+'&nbsp;&nbsp;</td>'+'<td>'+msg[index].o_num+'&nbsp;&nbsp;</td>'+'<td>¥'+msg[index].o_price+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><br>';
		                					var sp='配送费:¥'+sendprice+'<br>';
		                					var t = '共计:¥'+parseInt(tot+sendprice);
		                					var a = '&nbsp;&nbsp;&nbsp;&nbsp;<a id="lilin_jie" href="/order_lilin">选好了</a>';

		                					str_h = h+str+sp+t+a;
		                				});
		                					
		                				
		                				$('#lilin_car').html(str_h);
		                				
		                				}
		                				
		                		});

							}else{

								num=0;
								$('#{{$vv["id"]}}').html(0);

								$.ajaxSetup({
                    				headers: {
                        				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                    				}
                				});

		                		$.post('/order_lilin',{food_id:food_id,food_name:food_name,num:num,food_price:food_price,store_id:store_id},function(msg){

		                				var str = '';

		                				if(msg==''){
		                					// var yes_='<span>购物车为空</span>';
		                					$('#lilin_car').html("");

		                				}else{
											var h = "购物车<br>菜品 份数 单价<br>";
		                					var tot=0;
		                					$.each(msg, function(index, val) {
		                						
		                						tot = tot+val.o_price;
		                					str = str+'<td>'+msg[index].food_name+'&nbsp;&nbsp;</td>'+'<td>'+msg[index].o_num+'&nbsp;&nbsp;</td>'+'<td>¥'+msg[index].o_price+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><br>';
		                					var sp='配送费:¥'+sendprice+'<br>';
		                					var t = '共计:¥'+parseInt(tot+sendprice);
		                					var a = '&nbsp;&nbsp;&nbsp;&nbsp;<a id="lilin_jie" href="/order_lilin">选好了</a>';

		                					str_h = h+str+sp+t+a;
		                				});
		                					
		                				
		                				$('#lilin_car').html(str_h);

		                				}
		                				
		                		});
							}

							
							
						});

						
						
					})

					
				</script>
				<!-- 菜单点击事件  数字变化  购物车变化 end -->
						
							</div>
						</div>
					</li>
				@endforeach
				</ul>
			</div>
		</div>
		@endforeach
		<!-- 此分类下的菜 end-->
	</section>
</div>
<div class="side">
	<section class="menu-collect clearfix" id="widget-menu-collect">
		<div class="collect-btn " data-node="collectBtn" from="menu">
			<i></i>
			<span data-node="collectTxt">收藏商户</span>
		</div>
	</section>
	<section id="shop-notice" class="notice clearfix">
		<p class="warp"></p>
		<h2>商家公告</h2>
		<p class="notice-desc" data-node="shop-notice">
			{{$data['store_notice']}}
		</p>
		
	</section>
	
<section class="cart-section cart-fix" id="cart-section">
	
	<div class="cart-bar">
		
			
 

				</div>
			</table>
			<span class="" id="lilin_car"></span>
			


			
			
			
	</div>


</section>
</div>
<div class="backtop-section" id="backtop-section">
<div class="appdown" data-node="appdown">
<a id="backTop" class="back-top-action v-hide" href="javascript:;"></a>
<i data-node="appdown-img" class="appdown-img" usemap="#planetmap" style="display:block;"></i>
<a id="feedback" class="feedback" href="javascript:;"></a>
<map name="planetmap" id="planetmap">
<area shape="rect" coords="88,35,100,45" id="appdownClose" href="javascript:;">
</map>
</div>
</div>
</div>
<!--[if IE]>
<style type="text/css">
/*widget.cart*/
.cart .cart-panel .item-list .item .item-count .item-count, 
.cart .cart-panel .collect .item .item-count .item-count {
    line-height: 20px;
}
.cart .cart-panel .item-list .item .item-count .item-minus, 
.cart .cart-panel .collect .item .item-count .item-minus, 
.cart .cart-panel .item-list .item .item-count .item-plus, 
.cart .cart-panel .collect .item .item-count .item-plus {
    line-height: 18px;
}
</style>
<![endif]-->
<!--[if lt IE 10]>
<style type="text/css">
/*widget.filter*/
.menu-filter-fix .menu-filter-fix-filter .menuList.menu-open .caret {
    border-style: dashed;
    border-width: 5px;
    border-top-width: 0;
    border-bottom-style: solid;
    border-bottom-color: #333;
}
</style>
<![endif]-->

<input id="bdstoken" name="bdstoken" value="5ffe1e1101edcc65b9f9bf5bd716c0c4" type="hidden">
<input id="bindstoken" name="bindstoken" value="" type="hidden">
</div>



@endsection